UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j94JFDDlTa0jCd/+qFQMY5RYzuepfdBrbsa6AlEHc4M=' 
WHERE 
  key_id = '5dc5607f32db688d9ae07ba2c99b220c99bfc9b3b06e7449d48600a7b45026af' 
  AND (
    token = 'j94JFDDlTa0jCd/+qFQMY5RYzuepfdBrbsa6AlEHc4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050