UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T9FFLlvQIAmxBvOjgHmfhoJ3NC8upp/y1PdbApdxELA=' 
WHERE 
  key_id = '85c801df811af76066889160426bf02ecdae9185f45d78cd2ad7ad73837e249e' 
  AND (
    token = 'T9FFLlvQIAmxBvOjgHmfhoJ3NC8upp/y1PdbApdxELA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024