UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7EHlhkgdlR/6VfMnCFiUnpXejYxeN1knUHNHm2DrkOY=' 
WHERE 
  key_id = '1ed2e6e37028ea45316caa8c1e28bc9829c08fbb1757db0f17a700463a582be0' 
  AND (
    token = '7EHlhkgdlR/6VfMnCFiUnpXejYxeN1knUHNHm2DrkOY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022