UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nwtr3bbHT/rWvy17rlb1W7KaKooKTTVUsv/5Rf+A+nI=' 
WHERE 
  key_id = 'acfcc9963b2cab162bd4e3ab7239c53b19ec581f5143230b2a42d096f6a9e57d' 
  AND (
    token = 'nwtr3bbHT/rWvy17rlb1W7KaKooKTTVUsv/5Rf+A+nI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038