UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IWU8HjSH5tvNoH7yJl6AKQWDHB3A15ypIvDjC183w8Y=' 
WHERE 
  key_id = 'f7f00d166ddef54deab19b7c17a833db87d510851262b956a1fede8aa7f162f1' 
  AND (
    token = 'IWU8HjSH5tvNoH7yJl6AKQWDHB3A15ypIvDjC183w8Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037