UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xzh+M99mQ4n8fAczpiQ4JLiwPUXmIdu+9QKNpS1EpBw=' 
WHERE 
  key_id = 'f088e9ef0cbfe1944abe90ab639db861064bac4cbd0da7c3cf938530360d8e6f' 
  AND (
    token = 'xzh+M99mQ4n8fAczpiQ4JLiwPUXmIdu+9QKNpS1EpBw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034