UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EjNoawj4skuUZppaDmK4nW2jsBLo+uRGl6vN/0Ujs7U=' 
WHERE 
  key_id = 'cace8add04a22c5d1971ef84c7c0eb5106e923bf384898f228babec219c25daf' 
  AND (
    token = 'EjNoawj4skuUZppaDmK4nW2jsBLo+uRGl6vN/0Ujs7U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027