UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3psMOQPLmk75levKrFuw6isKOeYJJBk4/anFlRr1j34=' 
WHERE 
  key_id = '2835be05b7904b9042492c1f571673b70fb051432c74d852e6d2785b3e6b67c4' 
  AND (
    token = '3psMOQPLmk75levKrFuw6isKOeYJJBk4/anFlRr1j34=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024