UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jK+0XdY7tm/RBh2qLuS/4Xh5l/BVKNlIBo0SJqnMaVg=' 
WHERE 
  key_id = '7419855f5cc9984197cb582d4a5d568224c61356d99716dff179e9b6454ffb66' 
  AND (
    token = 'jK+0XdY7tm/RBh2qLuS/4Xh5l/BVKNlIBo0SJqnMaVg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023