UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2RIta/giKuPue827Id+9pU+Qc+cUueMpwEys7Cl1/c8=' 
WHERE 
  key_id = 'd6e4b9534b5c3a0f082f003cffeebd1eb52f8fd73cff9fd4dcff0d7d38c1e618' 
  AND (
    token = '2RIta/giKuPue827Id+9pU+Qc+cUueMpwEys7Cl1/c8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024