UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qq+MNVE01lur4CxQXekQl8uLLhkKi2A4fVUfJZLO8Ck=' 
WHERE 
  key_id = '622eaab7291900d52e35abd25c57754ae9420f2fac7516f439cfa257a343ffb6' 
  AND (
    token = 'qq+MNVE01lur4CxQXekQl8uLLhkKi2A4fVUfJZLO8Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022