UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eoq0t+RCSn0jaM5cqCr0ABfD4AzSV8YDbQg8RCAmXqE=' 
WHERE 
  key_id = 'b63914725f712f0add6f3bf624a7fea0df37e1b203e04e06c8c1c28620aadc5e' 
  AND (
    token = 'eoq0t+RCSn0jaM5cqCr0ABfD4AzSV8YDbQg8RCAmXqE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025