UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'erbC+/StPyT2lpj0gJaGKnAGT4XzDONfWeBkhZvvxc8=' 
WHERE 
  key_id = '57f7ca137f8e1754e8812fd05b74d71eaa3af26d7567c04d49b10319643bc859' 
  AND (
    token = 'erbC+/StPyT2lpj0gJaGKnAGT4XzDONfWeBkhZvvxc8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00057