UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XV7xEJzsVWuighcmy73ETil3e6+84Rt1ug4RiWLYasQ=' 
WHERE 
  key_id = 'c907871d6a764951933ac71c39622399b6191c9abadecb0579798de4a6705bc7' 
  AND (
    token = 'XV7xEJzsVWuighcmy73ETil3e6+84Rt1ug4RiWLYasQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055