UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9uSakEsxoo+1fxAntdIdU2jdRWasYZNnPVzNYX2Eeg=' 
WHERE 
  key_id = 'ee1913d5ca2ee8c54b902a503767a87e77a3bf04ac5f51510c27590c273ac4d6' 
  AND (
    token = 'x9uSakEsxoo+1fxAntdIdU2jdRWasYZNnPVzNYX2Eeg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00064