UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'atIAM/Avd6pr/BU3oO+28b36X3ZjLDAopyyp7xiVq0U=' 
WHERE 
  key_id = '2cca14bf115fe06c2d671a8f4220d275c713abe3f4706eb2b83ea89ca1dc3005' 
  AND (
    token = 'atIAM/Avd6pr/BU3oO+28b36X3ZjLDAopyyp7xiVq0U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029