UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FsIWkOKDviovbkiHUXI8LfxvkaUnMHV7xBxLzkkRqaQ=' 
WHERE 
  key_id = '11574575f3f769f3d4f73e69786851c6cb356deef68f27169d830743966f3c50' 
  AND (
    token = 'FsIWkOKDviovbkiHUXI8LfxvkaUnMHV7xBxLzkkRqaQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027