UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MApdamyNMfc4NC/Mm03wxuns7UXHXQVzJYeOaB8xFQI=' 
WHERE 
  key_id = 'ea457d3d724a98e09dfef4b83621b105cf957d6c7e7cb1c45cf1a88f9fc6bdcb' 
  AND (
    token = 'MApdamyNMfc4NC/Mm03wxuns7UXHXQVzJYeOaB8xFQI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036