UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'T/vhWypZX7+FP2REtHfNDsgbHkjeDV3kRD49KNqz6T4=' 
WHERE 
  key_id = '41481cc118b4278ce0e3baa79bc9cbc3431d3271008318d5333ce3bc71daeaa1' 
  AND (
    token = 'T/vhWypZX7+FP2REtHfNDsgbHkjeDV3kRD49KNqz6T4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018