UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DEdFANtTLbVr/2cCEmmE9EHsp5H4jKbWgmURAvcu7kY=' 
WHERE 
  key_id = 'd928081525afbeb7b09abfeb26fc7f7bd2bd7c2a65fccf1b481bdf588dedaba4' 
  AND (
    token = 'DEdFANtTLbVr/2cCEmmE9EHsp5H4jKbWgmURAvcu7kY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032