UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MFDNSzje4+gQ2M2su2UTue5Sy/0gx9Mo96bwZBy33Zo=' 
WHERE 
  key_id = '41edcf2336a10e71b450109fd0e5c21ce768aa1c0c9cd09f5fa37535b3a5ac7e' 
  AND (
    token = 'MFDNSzje4+gQ2M2su2UTue5Sy/0gx9Mo96bwZBy33Zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024