UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '++5IYQwjJVv8UhZ2J51kTlGllLITJWZwjL8mwo9qA2k=' 
WHERE 
  key_id = '5e58a1dd091d7243f236bf0d64b811e3a6b9021a2cf6d49a20ac75c4766e4444' 
  AND (
    token = '++5IYQwjJVv8UhZ2J51kTlGllLITJWZwjL8mwo9qA2k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045