UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JZ/Uxlv8GU3sVkBAIVMd/Bq0uknpd8gmm2rbeEQbvZs=' 
WHERE 
  key_id = '98c0efde726fc70ed4fa0d91a956be33dcd5337b36b9a9e2b4f804270b3e3300' 
  AND (
    token = 'JZ/Uxlv8GU3sVkBAIVMd/Bq0uknpd8gmm2rbeEQbvZs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025