UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xI5cBuwgNJYjhBZPxIYZAJdsA5HuJ1/GggUGf88THbU=' 
WHERE 
  key_id = '81bcdb8efc11722981eb9a163b7df1b10dd6b7375f7c62541e4681a225105109' 
  AND (
    token = 'xI5cBuwgNJYjhBZPxIYZAJdsA5HuJ1/GggUGf88THbU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033