UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j9ZTMqnTgFduABCpVGFbAh+Af3NcnnsquoStDpuAPVg=' 
WHERE 
  key_id = 'a3ec0e232c8eff3c0b19adb221523dbd3de0ae32b32046329bf47921ae48692b' 
  AND (
    token = 'j9ZTMqnTgFduABCpVGFbAh+Af3NcnnsquoStDpuAPVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046