UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UX+LvSGkiOTBLy7+jP9VczTEeEpHDg4Gwjk5TdX6OAA=' 
WHERE 
  key_id = 'd5fe8cd46bc18d15dccf9e491ec4c492a9c1c6ea9f7c5427bafc5e5296e76c4c' 
  AND (
    token = 'UX+LvSGkiOTBLy7+jP9VczTEeEpHDg4Gwjk5TdX6OAA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044