UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MUurvK8PWJ3eiOejAIukYky49RbdkamQ1t3ij2wjFsE=' 
WHERE 
  key_id = '25b17d8b3a59447f6b9e494e08957314b8ecd0f02ad5e95ad149033fa5d365ca' 
  AND (
    token = 'MUurvK8PWJ3eiOejAIukYky49RbdkamQ1t3ij2wjFsE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056