UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wRfz9TMdZjKAia2Sj/bb9/SWkA3aPD2h3tx28nDEkmU=' 
WHERE 
  key_id = '4398b8af3919e8a2525aa96b3d48d7277444f85b176e6cc995933c690c0ed0a4' 
  AND (
    token = 'wRfz9TMdZjKAia2Sj/bb9/SWkA3aPD2h3tx28nDEkmU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030