UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H8EXZFGHF+aCcPgSGPd1xUz9TLzHmgYiRvFReElvcuQ=' 
WHERE 
  key_id = 'a2c5f9c06fe59bd496d12d33fa64f9750f2f317307272ff37f80e35ced7b7958' 
  AND (
    token = 'H8EXZFGHF+aCcPgSGPd1xUz9TLzHmgYiRvFReElvcuQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025